#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2e5+6;
ll a[N];
int main()
{
	int n,q;
	cin>>n>>q;
	for(int i=1;i<=n;i++)cin>>a[i];
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i++)a[i]+=a[i-1];
	while(q--)
	{
		ll x;
		cin>>x;
		if(x>=a[n])cout<<n<<'\n';
		else 
		{
			int id=upper_bound(a+1,a+n+1,x)-a-1;
			cout<<id<<'\n';
		}
	}
	return 0;
}
